/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * GUI_OpcionesIdioma.java
 *
 * Created on 18-nov-2009, 19:54:47
 */
package GUI;

import java.awt.Dimension;
import java.awt.Toolkit;

/**
 *
 * @author Administrador
 */
public class GUI_OpcionesIdioma extends javax.swing.JDialog {

    private String idioma = "es";

    /** Creates new form GUI_OpcionesIdioma */
    public GUI_OpcionesIdioma(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
        centrarAplicacion();
        this.setDefaultCloseOperation(0);
        this.setVisible(true);
    }

    private void centrarAplicacion() {
        int width = this.getWidth();
        int height = this.getHeight();
        Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
        int x = (screen.width - width) / 2;
        int y = (screen.height - height) / 2;
        setBounds(x, y, width, height);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        JBEspanol = new javax.swing.JButton();
        JBEnglish = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Idioma/Language");
        setBounds(new java.awt.Rectangle(0, 0, 0, 0));
        setResizable(false);

        JBEspanol.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Archivos/Imagenes/idiomaEspanol.png"))); // NOI18N
        JBEspanol.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBEspanolActionPerformed(evt);
            }
        });

        JBEnglish.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Archivos/Imagenes/idiomaIngles.png"))); // NOI18N
        JBEnglish.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBEnglishActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addComponent(JBEspanol, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(40, 40, 40)
                .addComponent(JBEnglish, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(37, 37, 37))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(JBEnglish, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(JBEspanol, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(28, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void JBEspanolActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBEspanolActionPerformed
        // TODO add your handling code here:
        idioma = "es";
        this.setVisible(false);
    }//GEN-LAST:event_JBEspanolActionPerformed

    private void JBEnglishActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBEnglishActionPerformed
        // TODO add your handling code here:
        idioma = "en";
        this.setVisible(false);
    }//GEN-LAST:event_JBEnglishActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton JBEnglish;
    private javax.swing.JButton JBEspanol;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the idioma
     */
    public String getIdioma() {
        return idioma;
    }

}
